package com.jingdianjichi.subject.infra.basic.service.impl;

import com.jingdianjichi.subject.infra.basic.entity.SubjectLiked;
import com.jingdianjichi.subject.infra.basic.mapper.SubjectLikedDao;
import com.jingdianjichi.subject.infra.basic.service.SubjectLikedService;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;

import javax.annotation.Resource;
import java.util.List;

/**
 * 题目点赞表(SubjectLiked)表服务实现类
 *
 * @author makejava
 * @since 2025-02-26 14:39:52
 */
@Service("subjectLikedService")
public class SubjectLikedServiceImpl implements SubjectLikedService {
    @Resource
    private SubjectLikedDao subjectLikedDao;



    /**
     * 批量插入亲
     */
    @Override
    public void batchInsert(List<SubjectLiked> subjectLikedList) {
        for (SubjectLiked subjectLiked : subjectLikedList) {
            subjectLikedDao.insert(subjectLiked);
        }
    }

    /**
     * 统计总数
     */
    @Override
    public int countByCondition(SubjectLiked subjectLiked) {
        return subjectLikedDao.countByCondition(subjectLiked);
    }

    /**
     * 分页查询
     */
    @Override
    public List<SubjectLiked> queryPage(SubjectLiked subjectLiked, int start, Integer pageSize) {
        return subjectLikedDao.queryPage(subjectLiked,start,pageSize);
    }
}
